<template>
  <div class="item">
    <van-checkbox
      checked-color="deeppink"
      :checked="item.ischeck"
      @click="changecheck(item.iid)"
      class="box"
    ></van-checkbox>
    <van-card
      class="card"
      :num="item.number"
      :price="item.price"
      :desc="item.desc"
      :title="item.title"
      :thumb="item.image"
    />
  </div>
</template>

<script>
import {} from 'vue'
import { useStore } from 'vuex'
export default {
  props: ['item'],
  setup(props) {
    const store = useStore()
    const changecheck = (iid) => {
      store.commit('car/changeitemischeck', iid)
    }
    return {
      changecheck
    }
  }
}
</script>

<style lang="less" scoped>
.item {
  display: flex;
  align-items: center;
  .box {
    width: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
  }
  .card {
    flex: 1;
    overflow: hidden;
  }
  .van-card__title {
    width: 100%;
  }
}
</style>
